|
2020-2021 Sunseeker Telemetry and Lighting System
|
#include "driverlib.h"Go to the source code of this file.
Functions | |
| void | main (void) |
| void | USCI_B0_ISR (void) |
Variables | |
| uint8_t | RXData = 0 |
| uint8_t | TXData = 0 |
| void main | ( | void | ) |
Definition at line 81 of file eusci_b_spi_ex1_master.c.
References __delay_cycles(), __no_operation(), GPIO_setOutputLowOnPin(), i, param, and TXData.
| void USCI_B0_ISR | ( | void | ) |
Definition at line 178 of file eusci_b_spi_ex1_master.c.
References __delay_cycles(), RXData, and TXData.
| uint8_t RXData = 0 |
USCI_B0, SPI 3-Wire Master Incremented Data This example shows how SPI master talks to SPI slave using 3-wire mode. Incrementing data is sent by the master starting at 0x01. Received data is expected to be same as the previous transmission. eUSCI RX ISR is used to handle communication with the CPU, normally in LPM0. If high, P1.0 indicates valid data reception. Because all execution after LPM0 is in ISRs, initialization waits for DCO to stabilize against SMCLK. ACLK = ~32.768kHz, MCLK = SMCLK = DCO ~ 1048kHz. BRCLK = SMCLK/2
Use with SPI Slave Data Echo code example. If slave is in debug mode, P1.1 slave reset signal conflicts with slave's JTAG; to work around, use IAR's "Release JTAG on Go" on slave device. If breakpoints are set in slave RX ISR, master must stopped also to avoid overrunning slave RXBUF.
Tested on MSP430FR5969
-----------------
/|\ | |
| | |
Master—+->|RST | | | | P1.6|-> Data Out (UCB0SIMO) | | | P1.7|<- Data In (UCB0SOMI) | | | P2.2|-> Serial Clock Out (UCB0CLK)
This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:
This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.
Definition at line 78 of file eusci_b_spi_ex1_master.c.
| uint8_t TXData = 0 |
Definition at line 79 of file eusci_b_spi_ex1_master.c.